package com.xry.www;

import java.io.*;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;

public class test {
    public static void main(String[] args) throws IOException {
      IMAGE image =new IMAGE();
      String imageListPath="C:\\Users\\谢睿怡\\image\\imagelist";
      String imageDir="C:\\Users\\谢睿怡\\image";
      //File dir=new File("C:\\Users\\谢睿怡\\image");
      image.getUrlList("http://10.122.7.154/javaweb/data/images-url.txt",imageListPath);

      List<String> imageList;
      imageList= image.getImageList(imageListPath);

      long[] large=new long[5];
      List<File> images=new ArrayList<>();
      List<String> imagesort=new ArrayList<>();
      int i=0;

      image.downloadImage(imageList,images);

      image.imageSort(images,imagesort);

      File fw=new File("C:\\Users\\谢睿怡\\image\\images-sorted.txt");
      fw.createNewFile();
      BufferedWriter bufferedWriter=new BufferedWriter(new FileWriter(fw));
      for(String str:imagesort){
         bufferedWriter.write(str);
         bufferedWriter.newLine();
         bufferedWriter.flush();
      }
      bufferedWriter.close();
    }
}
